import request from "@/utils/request";

/**
 *菜单配置-----------------------------------------------
 */
//获取获取全部菜单信息-------------------------------------------
export function getRoutes(params) {
  return request({
    url: "/web/v1/PermissionMenuMain/getMenuList",
    method: "get",
    params
  });
}

//获取全部菜单信息--------------------------------------------
export function getMenuListAll() {
  return request({
    url: "/web/v1/PermissionMenuMain/getMenuListAll",
    method: "get"
  });
}

//获取按钮列表--------------------------------------------
export function getMenuBtn(params) {
  return request({
    url: "/web/v1/PermissionMenuMain/getMenuBtn",
    method: "get",
    params
  });
}

//删除菜单信息--------------------------------------------
export function delMenu(params) {
  return request({
    url: "/web/v1/PermissionMenuMain/del",
    method: "delete",
    params
  });
}

//添加或者修改菜单信息--------------------------------------------
export function addMenu(data) {
  return request({
    url: "/web/v1/PermissionMenuMain/inOrUp",
    method: "post",
    data
  });
}

/**
 *角色配置-----------------------------------------------
 */

//条件获取角色的list--------------------------------------------
export function getPowerList(params) {
  return request({
    url: "/web/v1/PermissionPower/getPowerList",
    method: "get",
    params
  });
}

//根据权限uuid，获取该角色的按钮列表信息--------------------------------------------
export function getPowerMenuList(params) {
  return request({
    url: "/web/v1/PermissionPower/getPowerMenuList",
    method: "get",
    params
  });
}

//添加或者修改信息--------------------------------------------
export function inOrUpRole(data) {
  return request({
    url: "/web/v1/PermissionPower/inOrUp",
    method: "post",
    data
  });
}

//添加用户权限关系--------------------------------------------
export function inPowerMenu(data) {
  return request({
    url: "/web/v1/PermissionPower/inPowerMenu",
    method: "post",
    data
  });
}

//条件获取用户的list--------------------------------------------
export function getUserList(params) {
  return request({
    url: "/web/v1/PermissionUser/getUserList",
    method: "get",
    params
  });
}
//条件获取角色的用户的list--------------------------------------------
export function getPowerUserList(params) {
  return request({
    url: "/web/v1/PermissionPower/getPowerUserList",
    method: "get",
    params
  });
}

//添加用户权限关系--------------------------------------------
export function inOrDelPowerUser(data) {
  return request({
    url: "/web/v1/PermissionPower/inOrDelPowerUser",
    method: "post",
    data
  });
}

//删除角色--------------------------------------------
export function delRole(params) {
  return request({
    url: "/web/v1/PermissionPower/del",
    method: "delete",
    params
  });
}
